package com.kgc.scd.service;

import com.kgc.scd.bean.Product;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created On : 2022/6/16.
 * <p>
 * Author     : nainai
 * <p>
 * Description: 商品库存业务接口
 */
@FeignClient(value = "blmall-server-ly-8103")
public interface ProductStockService {

    /**
     * @author : nainai
     * @date   : 2022/6/16
     * @param  : [java.lang.String, java.lang.String]
     * @return : boolean
     * @description : 订阅商品到货提醒
     */
    @PostMapping("/setArrivalRemind")
    Map<String, String> setArrivalRemind(@RequestParam("userId") String userId, @RequestParam("proId") String proId);

    /**
     * @author : nainai
     * @date   : 2022/6/16
     * @param  : [java.lang.String]
     * @return : java.util.List<com.kgc.scd.bean.Product>
     * @description : 查询用户已订阅到货商品
     */
    @GetMapping("/queryUserArrivalRemind")
    List<Product> queryUserArrivalRemind(@RequestParam("userId") String userId);

    /**
     * @author : nainai
     * @date   : 2022/6/16
     * @param  : [java.lang.String, java.lang.Integer]
     * @return : java.util.Map<java.lang.String,java.lang.String>
     * @description : 添加商品库存
     */
    @PostMapping("/insertProductStock")
    Map<String, String> insertProductStock(@RequestParam("proId") String proId, @RequestParam("stock") Integer stock);
}

